Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baremetal / Add stork consul scenario #572

Merged
merged 3 commits into from
Mar 21, 2022
Merged

Conversation

pjgg
Copy link
Contributor

@pjgg pjgg commented Mar 15, 2022

Description

Verifies Stork-consul integration in order to provide service discovering and round-robin load balancing between services

StorkServiceDiscoveryIT scenario deploys four services:

  • Pung: is a simple endpoint that returns "pung" as a string
  • Pong: is a simple endpoint that returns "pong" as a string
  • PongReplica: is a "Pong service" replica, that is deployed in another physical service
  • Ping: is the main client microservice that will use pung and pong (Pong and PongReplica) services. The service
    discovery will be done by Stork, and the request dispatching between "pong" services is going to be done by Stork load balancer.

Test Plan coverage

  • Service Discovery / baremetal / k8s
    • Service Discovery by name
  • Load-Balancing / baremetal / k8s
    • Round-Robin Load Balancing

Reported issues:

Missing stork quarkus properties: quarkusio/quarkus#24341
Service discovery expiration time: quarkusio/quarkus#24343

@pjgg pjgg marked this pull request as draft March 15, 2022 19:03
@pjgg pjgg force-pushed the feat/stork-consul branch 2 times, most recently from 09c96ed to e2cff3e Compare March 16, 2022 09:44
@pjgg pjgg requested a review from fedinskiy March 16, 2022 10:15
@pjgg pjgg marked this pull request as ready for review March 16, 2022 10:15
@pjgg pjgg changed the title Add stork consul scenario baremetal / Add stork consul scenario Mar 16, 2022
@pjgg pjgg changed the title baremetal / Add stork consul scenario Baremetal / Add stork consul scenario Mar 16, 2022
@pjgg pjgg force-pushed the feat/stork-consul branch from e2cff3e to d19e27d Compare March 16, 2022 10:52
@pjgg pjgg force-pushed the feat/stork-consul branch from d19e27d to 5cddc05 Compare March 16, 2022 14:38
@pjgg pjgg requested a review from fedinskiy March 16, 2022 14:39
@pjgg pjgg force-pushed the feat/stork-consul branch from 5cddc05 to b8544ac Compare March 16, 2022 16:42
@pjgg pjgg requested a review from fedinskiy March 16, 2022 16:43
@pjgg pjgg force-pushed the feat/stork-consul branch from b8544ac to 4c9fb44 Compare March 17, 2022 13:17
public void init(@Observes StartupEvent ev, Vertx vertx) {
if (serviceDiscoveryType.equalsIgnoreCase("consul")) {
ConsulClient client = ConsulClient.create(vertx,
new ConsulClientOptions().setHost(host).setPort(Integer.parseInt(port)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.port, if you don't mind. Also, can't we have integer ConfigProperties?

} catch (IOException e) {
fail("no free port available.");
}
return String.valueOf(-1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will Quarkus handle such port number properly?

public void init(@Observes StartupEvent ev, Vertx vertx) {
if (serviceDiscoveryType.equalsIgnoreCase("consul")) {
ConsulClient client = ConsulClient.create(vertx,
new ConsulClientOptions().setHost(host).setPort(Integer.parseInt(port)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, and everywhere in Resources:

Suggested change
new ConsulClientOptions().setHost(host).setPort(Integer.parseInt(port)));
new ConsulClientOptions().setHost(host).setPort(Integer.parseInt(this.port)));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it as it's other modules. there is no a team agreement about that

Copy link
Contributor Author

@pjgg pjgg Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, we are following this principle: https://checkstyle.sourceforge.io/config_coding.html#RequireThis
But is true that is not added to checkstyle template

<module name="RequireThis">
  <property name="validateOnlyOverlapping" value="true"/>
</module>

@pjgg pjgg force-pushed the feat/stork-consul branch from 0efc8f3 to 10d7dd9 Compare March 21, 2022 15:39
- default service discovery
- default load balncer
@pjgg pjgg force-pushed the feat/stork-consul branch from 10d7dd9 to fb8ec0b Compare March 21, 2022 15:57
@pjgg pjgg requested a review from fedinskiy March 21, 2022 16:17
@pjgg pjgg merged commit a813ce6 into quarkus-qe:main Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants